package com.example.agriculture.controller;

import com.example.agriculture.entity.AdminInfor;
import com.example.agriculture.entity.Producer;
import com.example.agriculture.service.AdminInforService;
import com.example.agriculture.service.ProducerService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import java.util.List;

/**
 * (AdminInfor)表控制层
 *
 * @author makejava
 * @since 2022-09-11 22:45:46
 */

//注解
@Controller
public class AdminInforController {


    @Resource
    private ProducerService producerService;

    //登录主页面
    @GetMapping({"/admin_prodcuerinfor"})
    public ModelAndView AdminProducer(){
        ModelAndView modelAndView_a_producer = new ModelAndView("BMS/a_producer");
        List<Producer> producers = producerService.queryAllByLimit(0,5);
        modelAndView_a_producer.addObject("infor",producers);
        return modelAndView_a_producer;
    }
}